﻿

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Data;

namespace .BizLogic
{
    using RDIFramework.BizLogic;
    using RDIFramework.Utilities;

    /// <summary>
    /// pmwebsiteEntity
    /// pm-站点信息
    /// 
    /// 修改纪录
    /// 
    /// 2025-01-18 版本：3.5  创建主键。
    /// 
    /// 版本：3.5
    /// 
    /// <author>
    /// <name></name>
    /// <date>2025-01-18</date>
    /// </author>
    /// </summary>
    [Serializable]
    public partial class pmwebsiteEntity : BaseEntity
    {
        /// <summary>
        /// 站点id
        /// </summary>
        [Key] 
        [ScaffoldColumn(false)] 
        [DataMember] 
        public int? Id { get; set; } 

        /// <summary>
        /// 站群id
        /// </summary>
        [Display(Name = "站群id")] 
        [Required(ErrorMessage = "需要输入站群id")]
        [DataMember] 
        public int? GroupId { get; set; } 

        /// <summary>
        /// 网站名称
        /// </summary>
        [StringLength(200, ErrorMessage = "网站名称不能超过200个字符")] 
        [Display(Name = "网站名称")] 
        [Required(ErrorMessage = "需要输入网站名称")]
        [DataMember] 
        public string WebsiteName { get; set; } 

        /// <summary>
        /// 网站简称
        /// </summary>
        [StringLength(200, ErrorMessage = "网站简称不能超过200个字符")] 
        [Display(Name = "网站简称")] 
        [Required(ErrorMessage = "需要输入网站简称")]
        [DataMember] 
        public string WebsiteShortname { get; set; } 

        /// <summary>
        /// Pc端网址
        /// </summary>
        [StringLength(200, ErrorMessage = "Pc端网址不能超过200个字符")] 
        [Display(Name = "Pc端网址")] 
        [Required(ErrorMessage = "需要输入Pc端网址")]
        [DataMember] 
        public string UrlPc { get; set; } 

        /// <summary>
        /// 原pc端网址
        /// </summary>
        [StringLength(200, ErrorMessage = "原pc端网址不能超过200个字符")] 
        [Display(Name = "原pc端网址")] 
        [Required(ErrorMessage = "需要输入原pc端网址")]
        [DataMember] 
        public string WebsitePcOld { get; set; } 

        /// <summary>
        /// 移动端网址
        /// </summary>
        [StringLength(200, ErrorMessage = "移动端网址不能超过200个字符")] 
        [Display(Name = "移动端网址")] 
        [Required(ErrorMessage = "需要输入移动端网址")]
        [DataMember] 
        public string UrlMobile { get; set; } 

        /// <summary>
        /// 建站时间
        /// </summary>
        [StringLength(, ErrorMessage = "建站时间不能超过个字符")] 
        [Display(Name = "建站时间")] 
        [Required(ErrorMessage = "需要输入建站时间")]
        [DataMember] 
        public string WebsiteCreatetime { get; set; } 

        /// <summary>
        /// 最后停站时间
        /// </summary>
        [StringLength(, ErrorMessage = "最后停站时间不能超过个字符")] 
        [Display(Name = "最后停站时间")] 
        [Required(ErrorMessage = "需要输入最后停站时间")]
        [DataMember] 
        public string WebsiteStoptime { get; set; } 

        /// <summary>
        /// 创建时间
        /// </summary>
        [StringLength(, ErrorMessage = "创建时间不能超过个字符")] 
        [Display(Name = "创建时间")] 
        [Required(ErrorMessage = "需要输入创建时间")]
        [DataMember] 
        public string CreateTime { get; set; } 

        /// <summary>
        /// 修改时间
        /// </summary>
        [StringLength(, ErrorMessage = "修改时间不能超过个字符")] 
        [Display(Name = "修改时间")] 
        [Required(ErrorMessage = "需要输入修改时间")]
        [DataMember] 
        public string UpdateTime { get; set; } 

        /// <summary>
        /// 创建人
        /// </summary>
        [StringLength(64, ErrorMessage = "创建人不能超过64个字符")] 
        [Display(Name = "创建人")] 
        [Required(ErrorMessage = "需要输入创建人")]
        [DataMember] 
        public string CreateBy { get; set; } 

        /// <summary>
        /// 修改人
        /// </summary>
        [StringLength(64, ErrorMessage = "修改人不能超过64个字符")] 
        [Display(Name = "修改人")] 
        [Required(ErrorMessage = "需要输入修改人")]
        [DataMember] 
        public string UpdateBy { get; set; } 

        /// <summary>
        /// 排序
        /// </summary>
        [Display(Name = "排序")] 
        [Required(ErrorMessage = "需要输入排序")]
        [DataMember] 
        public int? Sortnum { get; set; } 

        /// <summary>
        /// 完成状态,1=进行中,0=已完成
        /// </summary>
        [Display(Name = "完成状态,1=进行中,0=已完成")] 
        [Required(ErrorMessage = "需要输入完成状态,1=进行中,0=已完成")]
        [DataMember] 
        public byte? CompletedStatus { get; set; } 

        /// <summary>
        /// 拼音码
        /// </summary>
        [StringLength(100, ErrorMessage = "拼音码不能超过100个字符")] 
        [Display(Name = "拼音码")] 
        [Required(ErrorMessage = "需要输入拼音码")]
        [DataMember] 
        public string Pinyin { get; set; } 

        /// <summary>
        /// 运行状态,0=停用,1=正常
        /// </summary>
        [Display(Name = "运行状态,0=停用,1=正常")] 
        [Required(ErrorMessage = "需要输入运行状态,0=停用,1=正常")]
        [DataMember] 
        public byte? Status { get; set; } 

        /// <summary>
        /// 备注
        /// </summary>
        [StringLength(, ErrorMessage = "备注不能超过个字符")] 
        [Display(Name = "备注")] 
        [Required(ErrorMessage = "需要输入备注")]
        [DataType(DataType.MultilineText)]
        [DataMember] 
        public String Remark { get; set; } 

        /// <summary>
        /// 站点机构类型
        /// </summary>
        [Display(Name = "站点机构类型")] 
        [Required(ErrorMessage = "需要输入站点机构类型")]
        [DataMember] 
        public int? WebsiteOrgType { get; set; } 

        /// <summary>
        /// 构造函数
        /// </summary>
        public pmwebsiteEntity()
        {
        }


        /// <summary>
        /// 从数据行读取
        /// </summary>
        /// <param name="dataRow">数据行</param>
        protected override BaseEntity GetFrom(IDataRow dataRow)
        {
            this.Id = BusinessLogic.ConvertToNullableInt(dataRow[pmwebsiteTable.FieldId]);
            this.GroupId = BusinessLogic.ConvertToNullableInt(dataRow[pmwebsiteTable.FieldGroupId]);
            this.WebsiteName = BusinessLogic.ConvertToString(dataRow[pmwebsiteTable.FieldWebsiteName]);
            this.WebsiteShortname = BusinessLogic.ConvertToString(dataRow[pmwebsiteTable.FieldWebsiteShortname]);
            this.UrlPc = BusinessLogic.ConvertToString(dataRow[pmwebsiteTable.FieldUrlPc]);
            this.WebsitePcOld = BusinessLogic.ConvertToString(dataRow[pmwebsiteTable.FieldWebsitePcOld]);
            this.UrlMobile = BusinessLogic.ConvertToString(dataRow[pmwebsiteTable.FieldUrlMobile]);
            this.WebsiteCreatetime = BusinessLogic.ConvertToString(dataRow[pmwebsiteTable.FieldWebsiteCreatetime]);
            this.WebsiteStoptime = BusinessLogic.ConvertToString(dataRow[pmwebsiteTable.FieldWebsiteStoptime]);
            this.CreateTime = BusinessLogic.ConvertToString(dataRow[pmwebsiteTable.FieldCreateTime]);
            this.UpdateTime = BusinessLogic.ConvertToString(dataRow[pmwebsiteTable.FieldUpdateTime]);
            this.CreateBy = BusinessLogic.ConvertToString(dataRow[pmwebsiteTable.FieldCreateBy]);
            this.UpdateBy = BusinessLogic.ConvertToString(dataRow[pmwebsiteTable.FieldUpdateBy]);
            this.Sortnum = BusinessLogic.ConvertToNullableInt(dataRow[pmwebsiteTable.FieldSortnum]);
            this.CompletedStatus = BusinessLogic.ConvertToString(dataRow[pmwebsiteTable.FieldCompletedStatus]);
            this.Pinyin = BusinessLogic.ConvertToString(dataRow[pmwebsiteTable.FieldPinyin]);
            this.Status = BusinessLogic.ConvertToString(dataRow[pmwebsiteTable.FieldStatus]);
            this.Remark = BusinessLogic.ConvertToString(dataRow[pmwebsiteTable.FieldRemark]);
            this.WebsiteOrgType = BusinessLogic.ConvertToNullableInt(dataRow[pmwebsiteTable.FieldWebsiteOrgType]);
            return this;
        }
    }
}
